class Solution {
public:
    int brokenCalc(int startValue, int target) {
        int ret = 0;
        while(target > startValue) // 进来先是target大
        {
            if(target % 2 == 1)
                ++target;
            else
                target /= 2;
            ++ret;
        }
        return ret + startValue - target;
    }
};